﻿using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XT.Model;

namespace XT.Repository
{
    public class RoomRepository : Repository<Room, Int32>, IRoomRepository
    {
        public RoomRepository(DataContext context)
        {
            Context = context;
        }

        public IEnumerable<Room> FindAllByDate()
        {
            return FindAll<Room>(o => o.OrderByDescending(obj => obj.Room_Created_Date));        
        }


        public IEnumerable<Room> FindAllByViews()
        {
            return FindAll<Room>(o => o.OrderByDescending(obj => obj.Viewed_Count));   
        }

        
    }
}
